import time

from app.modules.apps.container_tomcat import TomcatMultiWarApp, TomcatApp
from app.modules.common import network

tomcat = TomcatApp(app_id='gzidc:ebay-adapter',
                   app_name='ebay-adapter',
                   zone_home_path='/usr/local/app/uc.gzidc.area',
                   zone_alias='gzidc',
                   port='3480',
                   nas_app_package_path='/usr/local/Beetle/projects/'
                                        'ebay-adapter/ebay-adapter_1.2.6.ISP20.SNAPSHOT/'
                                        '20161102-173826/target/ebay-adapter-1.2.6.ISP20.SNAPSHOT_161102_093755',
                   )

tomcat.stop()
tomcat.uninstall_app()
tomcat.install_app()
tomcat.restart()
print tomcat.is_started()

time.sleep(3)
print tomcat.is_started()
time.sleep(3)
#tomcat.stop()
print tomcat.is_started()
